<div  id="categories_menu" class="nav_left_middle">
	<?php if($categories){ ?>
		<ul>            
			<?php foreach($categories as $item){ ?>                  
                <?php if(1==0){ ?>
				<li class="categories_list<?php echo stristr($path,  $item['path']) ? ' current' : ''; ?>">
                <?php } ?>
                
                <?php $categories_list = explode(',', $item['path']); ?>
                <li class="categories_list<?php echo in_array((int)$path,  $categories_list) ? ' current' : ''; ?>">
					<a class="category_title" href="<?php echo $item['href']; ?>"><?php echo $item['name']; ?></a>
					<?php if(!empty($item['children'])){ ?>
						<ul class="left_sup">                            
							<?php foreach($item['children'] as $child){ ?>                                 
								<li <?php echo stristr($path, $child['path']) ? 'class="active"' : ''; ?>>
									<a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a>
                                    <?php if(!empty($child['children'])){ ?> 
                                        <ul class="left_sup2">
                                            <?php foreach($child['children'] as $child_level2){ ?>
                                                <li <?php echo stristr($path, $child_level2['path']) ? 'class="active"' : ''; ?>>
                                                    <a href="<?php echo $child_level2['href']; ?>"><?php echo $child_level2['name']; ?></a>
                                                </li>
                                            <?php } ?>        
                                        </ul> 
                                    <?php } ?>
								</li>                                
							<?php } ?>
						</ul>
					<?php } ?>
				</li>                
			<?php } ?>            
		</ul>
	<?php } ?>   
</div>

<script type="text/javascript"><!-- 	
	jQuery(document).ready(function(){         
		initCategoryMenu();
	}) 
    
    function initCategoryMenu() {
        jQuery('#categories_menu li ul.left_sup').hide();
        jQuery('#categories_menu li ul.left_sup2').hide(); 
        jQuery('#categories_menu li.current ul.left_sup').show();       
        jQuery('#categories_menu li.active ul.left_sup2').show();
        jQuery('#categories_menu li a.category_title').click(function(event){
            /*
            var checkElement = jQuery(this).next();
            if((checkElement.is('ul')) && (jQuery(checkElement).is(':visible'))) {
                return false;
            }
            if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
                jQuery('#categories_menu li ul:visible').slideUp('normal');
                checkElement.slideDown('normal');
                return false;
            }
            */
        });
    }
//--></script>